package com.asm.repository;

import com.asm.entity.sys.Book;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

public interface BookRepository extends JpaRepository<Book, Long> {
    Page<Book> findByWorkerId(Long workerId, Pageable page);

    Page<Book> findByContractId(Long contractId, Pageable page);

    @Query("select c from Book c where c.isDel=false ")
    Page<Book> findAll(PageRequest of);
//    Page<Book> findAllByIsDelFalse(Boolean isDel,Pageable page);
}
